JQuery

How to get selected radio button value using jQuery?

How to get selected radio button value using jQuery? , someone asked me to explain?

In this article, Iwill show you how to know which Radio button selected using JQuery. You can getradio button selected value by group name of radio button using checkedproperty. 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('input').on('change', function () {
                alert($('input[name=Countries]:checked').val());
            });
        });
    </script>
<form id="Form1">
        Select your Country:
         <br />
        <input type="radio" name="Countries" value="India" />
        India
        <br />
        <input type="radio" name="Countries" value="Pakistan" />
        Pakistan
        <br />
        <input type="radio" name="Countries" value="Bangladesh" />
        Bangladesh
        <br />
</form> 

Description: 

In above example, ifthe user selects the Country from the country List you can get the selectedcountry by group name (Countries) using checked property.

Output:

How to get selected radio button value using jQuery

Post your comments / questions